package com.pubinfo.passbook.common.model.dto.contract;

import com.pubinfo.passbook.common.aspect.NotLessThanZero;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@ApiModel(value = "ApplyInvoiceParam", description = "发票申请参数")
@ToString
public class ApplyInvoiceParam {

    @ApiModelProperty("合同ID")
    @NotNull(message = "合同ID不能为空")
    private Integer contractId;
    
    @ApiModelProperty("合同对方名称")
    @NotBlank(message = "合同对方名称不能为空")
    private String partbName;
    
    @ApiModelProperty("税号")
    @NotEmpty(message = "税号不能为空")
    private String socialCode;
    
    @ApiModelProperty("收款计划id")
    @NotNull(message = "收款计划id不能为空")
    private Integer performanceId;
    @ApiModelProperty("地址电话")
    @NotEmpty(message = "地址电话不能为空")
    private String consAddr;
    
    @ApiModelProperty("开票金额")
    @NotNull(message = "开票金额不能为空")
    @NotLessThanZero(message = "开票金额需大于0")
    private BigDecimal invoiceAmount;
    
    @ApiModelProperty("税率")
    @NotNull(message = "税率不能为空")
    @NotLessThanZero(message = "税率需大于0")
    @DecimalMax(value = "1", message = "税率需小于1")
    private BigDecimal invoiceRate;

}
